<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>校验</title>
</head>
<body>
    <form autocomplete="off">
        姓名：<input type="text" id="username"><span id="uSpan"></span><br/>
        密码：<input type="password" id="password"><br/>
        <input type="submit" value="注册">
    </form>

</body>
<script src="js/jquery-3.3.1.min.js"></script>
<!--<script>
    $("#username").blur(function (){
        let username=$("#username").val();

        $.get("ajxa","username="+ username ,function (date){
            $("#uSpan").html(date);
        },"text"
        );
    });
</script>-->

<!--<script>
    $("#username").blur(function (){
        let username=$("#username").val();
        $.post("ajxa","username="+username,function (dote) {
            $("#uSpan").html(dote);
        },"text"
        );

    });
</script>-->
<!--<script>
    $("#username").blur(function (){
        let username=$("#username").val();
        $.ajax({url:"ajxa",
            async:true,data:"username="+username,
            type:"GET",
            dataType:"text",
            success:function (data){
            $("#uSpan").html(data);
            },error:function (){
            alert("操作失败。。。");
            }

        });

    });-->
<script>
    $("#username").blur(function () {
        let username=$("#username").val();
        $.ajax({url:"ajxa",
            async:true,
            data:"username="+username,
            type:"GET",
            dataType:"text",
            success:function (data){
            $("#uSpan").html(data);
            },error:function (){
            alert("操作错误")
            }
        })
    })
</script>
</html>